<?php

class News extends CI_Controller {
    
    public function __construct() {
        parent::__construct();
        $this->load->model(array(
            'news_model'
        ));
        $this->load->library(array(
            'uri'
        ));
    }
    
    public function index($seccion) {
        $news['contenido'] = $this->news_model->get_news($seccion);
        $news['seccion'] = $seccion;
        
        $this->load->view('layout/header');
        $this->load->view('layout/submenu-news');
        $this->load->view('news/contenido', $news);
        $this->load->view('layout/frases');
        $this->load->view('layout/footer');
    }
    
    public function noticia($idnews) {
        $datos = array(
            'idnews' => $idnews
        );
        
        $data['new'] = $this->news_model->get_where($datos);
        
        $this->load->view('layout/header');
        $this->load->view('layout/submenu-news');
        $this->load->view('news/noticia', $data);
        $this->load->view('layout/frases');
        $this->load->view('layout/footer');
    }
}
?>
